package com.bbs.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bbs.mapper.PostMapper;
import com.bbs.pojo.Post;

@Service
public class PostServiceImpl implements PostService {

	@Autowired
	private PostMapper postMapper;

	// 查询所有
	@Override
	public List<Post> findPostAll() {

		return postMapper.findPostAll();
	}

	// 根据id删除
	@Override
	public void deletePostById(Integer id) {
		postMapper.deletePostById(id);
	}

	// 查看详情
	@Override
	public Post bloglist(Integer id) {

		return postMapper.bloglist(id);
	}

	// 根据title模糊查询
	@Override
	public List<Post> selectBlogList(String title) {

		return postMapper.selectBlogList(title);
	}

	// 添加
	@Override
	public void addBlog(Post post) {
		// TODO Auto-generated method stub
		postMapper.addBlog(post);
	}
	// 根据类型查询
	@Override
	public List<Post> findPostByType(String postType) {
		// TODO Auto-generated method stub
		return postMapper.findPostByType(postType);
	}
	

	
}
